#{extends 'orgLead.html' /} #{ifErrors} ${error} #{/ifErrors}
<title>Users Restrictions</title>
<table>
	<tr>
		<td><b>Department</b>
		</td>
		<td><b>User</b>
		</td>
		<td><b>Reason</b>
		</td>
	</tr>
	<tr>
		<form action="@{Application.doBlockUserFromDepartment()}">
			<input type="hidden" name="departmentId" value="${department.id}">
			<td><b><input type="text" disabled="disabled"
					value="${department.name}">
			</b>
			</td>
			<td><select name="userId">
					<option value="0">User</option> #{if allIdeaDevelopers} #{list
					items: allIdeaDevelopers, as:'ideaDeveloper'}
					<option value="${ideaDeveloper.user.id}">${ideaDeveloper.user.nickName}</option>
					#{/list}
			</select> #{/if}</td>
			<td><input type="text" name="reason">
			</td>
	</tr>
	<tr>
		<td><input type="submit" value="Block User">
		</td>
		</form>
	</tr>
	<tr>#{if allBlocked}
		<form action="@{Application.doUnblockUserFromDepartment()}">
			<input type="hidden" name="departmentId" value="${department.id}">
			<td><b><input type="text" disabled="disabled"
					value="${department.name}">
			</b>
			</td>
			<td><select name="userId">
					<option value="0">User</option>  #{list
					items: allBlocked, as:'blocked'}
					<option value="${blocked.user.id}">${blocked.user.nickName}</option>
					#{/list}
			</select> </td>
			<td><input type="text" name="reason">
			</td>
	</tr>
	<tr>
		<td><input type="submit" value="Unblock User">
		</td>#{/if}
		</form>
	</tr>
</table>
<span style="color: #c00" class="error"> #{error 'reason' /}</span>
<br>
<a href="@{Application.viewDepartment(department.id)}">Back to
	${department.name}</a>



